SG FileSys
NameMask Property

©1998 by Stinga

Enumerator Object     Constants     Error Codes    
Description

Returns or sets file name mask.

Syntax

object.NameMask As String

The object is expression that evaluates to the Enumerator object.

Remarks

During enumeration process, file and folder names are matched against the name mask. If name is matched, that file or folder is accepted and emitted as next valid item. Inside name mask string, you can use wildcard characters:

    * - matches 0 or more characters in file name text
    ? - matches exactly one character in file name text

Example

Following example prints all directories with name that starts with letter 's' and ends with letter 'p':

 Option Explicit
 Dim en, item
 Set en = CreateObject("SGFileSys.Enumerator")

 en.RootPath = "C:/"
 en.Recurse = True
 en.NameMask = "s*p.*"
 en.AttributeMask = sgfDirectory

 For Each item In en.Items
    WScript.Echo item.Path
 Next